Implement core disposal logic for explicit resource management#5079
Implement core disposal logic for explicit resource management#5079abhinavs1920 wants to merge 13 commits intoboa-dev:mainfrom
Conversation
Signed-off-by: Abhinav Sharma <abhinavs1920bpl@gmail.com>
Test262 conformance changes
Tested main commit: |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5079 +/- ##
===========================================
+ Coverage 47.24% 59.46% +12.21%
===========================================
Files 476 582 +106
Lines 46892 63236 +16344
===========================================
+ Hits 22154 37603 +15449
- Misses 24738 25633 +895 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Abhinav Sharma <abhinavs1920bpl@gmail.com>
Signed-off-by: Abhinav Sharma <abhinavs1920bpl@gmail.com>
…es opcode, removing runtime scope depth tracking Signed-off-by: Abhinav Sharma <abhinavs1920bpl@gmail.com>
Signed-off-by: Abhinav Sharma <abhinavs1920bpl@gmail.com>
There was a problem hiding this comment.
Looks great, I really like the staged approach you're doing to implement the feature.
One thing though is that we need to gate everything behind the experimental feature while the proposal is not in stage 4. The parser can stay as it is since that usually doesn't get gated, but the bytecompiler should throw an error instruction instead of pushing a resource to the resources stack if the feature is not enabled.
|
Done, pushed the fix. Makes sense to keep unfinished proposals gated, I should've caught that myself looking at how import.defer was handled :) Quick question while I'm here: for the next PR I'm planning to wire up disposal into the exception handling path (try-finally integration + SuppressedError). Is there anything specific about how the current handler/finally mechanism works that I should be aware of before diving in, or is the existing |
Signed-off-by: Abhinav Sharma <abhinavs1920bpl@gmail.com>
|
Yes, I imagine you can reuse the code that we have for |
|
Just went through both files. The picture is clearer now, For using, I think the approach would be: push a Does that sound like the right direction, or is there a cleaner way you had in mind :) |
This Pull Request fixes/closes #4445 .
Make
usingactually dispose ( continued work )Follow-up to my last PR (#4649) that added parsing.
Now when a block ends, resources get cleaned up properly.
usingand cleans up at end of blocksWorks like: